package com.ssm.web;

import java.util.List;

public class Page<T> {
	
	/**
	 * 当前页
	 */
	private Integer currentPage = 1;
	
	/**
	 * 每页记录数
	 */
	private Integer pageSize = 10;
	
	/**
	 * 总页数
	 */
	private Integer pageCount;
	
	/**
	 * 总记录数
	 */
	private Integer count;
	
	/**
	 * 记录信息
	 */
	private List<T> record;

	public Integer getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPageCount() {
		pageCount = ((double) this.count / (double) 10) > (this.count / 10) ? this.count
				/ 10 + 1
				: this.count / 10;
		pageCount = pageCount == 0 ? 1 : pageCount;
		return pageCount;
	}

	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public List<T> getRecord() {
		return record;
	}

	public void setRecord(List<T> record) {
		this.record = record;
	}

	@Override
	public String toString() {
		return "Page [currentPage=" + currentPage + ", pageSize=" + pageSize + ", pageCount="
				+ pageCount + ", count=" + count + ", record=" + record + "]";
	}
}
